cmake_minimum_required(VERSION 3.22.1)

project(usb_video)

#添加宏定义，设置为openharmony模式
add_definitions(-D__OPENHARMONY__)

add_library(usb_video SHARED
            usb_video.cpp
            camera/camera_factory_helper.cpp
            camera/camera_factory_v4l2_impl.cpp
            camera/video_v4l2_utils.cpp
            utils/img_util.cpp
            utils/napi_utils.cpp
            render/PluginManager.cpp
            render/PluginWindowRender.cpp

)


target_include_directories(usb_video PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/utils/headers
        ${CMAKE_CURRENT_SOURCE_DIR}/render/headers
        ${CMAKE_CURRENT_SOURCE_DIR}/camera/headers
        ${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/include
        ${CMAKE_CURRENT_SOURCE_DIR}/opencv
)

target_link_libraries(usb_video
            libace_napi.z.so
            hilog_ndk.z
            libace_ndk.z.so
            libnative_window.so
            librawfile.z.so

            ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libopencv_core.so.410
            ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libopencv_imgcodecs.so.410
            ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libopencv_imgproc.so.410
)